<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
	<meta charset="utf-8" />
	
	<title>KindEditor JSP</title>
	<link rel="stylesheet" href="assets/plugins/kindeditor/themes/default/default.css" />
	<link rel="stylesheet" href="assets/plugins/kindeditor/plugins/code/prettify.css" />
	<script charset="utf-8" src="assets/plugins/kindeditor/kindeditor.js"></script>
	<script charset="utf-8" src="assets/plugins/kindeditor/lang/zh_CN.js"></script>
	<script charset="utf-8" src="assets/plugins/kindeditor/plugins/code/prettify.js"></script>
	<script>
		KindEditor.ready(function(K) {
			var editor1 = K.create('textarea[name="news.content"]', {
				cssPath : 'assets/plugins/kindeditor/plugins/code/prettify.css',
				uploadJson : 'assets/plugins/kindeditor/jsp/upload_json.jsp',
				fileManagerJson : 'assets/plugins/kindeditor/jsp/file_manager_json.jsp',
				allowFileManager : true,
				afterCreate : function() {
					var self = this;
					K.ctrl(document, 13, function() {
						self.sync();
						document.forms['example'].submit();
					});
					K.ctrl(self.edit.doc, 13, function() {
						self.sync();
						document.forms['example'].submit();
					});
				}
			});
			prettyPrint();
		});
	</script>
	<style type="text/css">
		#editpanel form  input[type='text']{
			width:250px;
			height:40px;
			font-size:15px;
			margin-left:3em;
			margin-bottom:1em;
		}
		#editpanel form  input[type='submit']{
			display:block;
			width:100px;
			height:35px;
			border:none;
			background:#565656;
			float:left;
			
			margin-left:210px;
		}
		#editpanel form  input[type='submit']:hover{
			border:1 solid white;
			background:#345563;
		}
		#editpanel form textarea {
			width:700px;
			height:300px;
			visibility:hidden;
		}
	</style>
</head>
<body>
	<div id="editpanel">
		
		<form name="example" method="post" action="newsAction!addNews">
			<input  type="text" name="news.title" placeholder="标题"/>
			<textarea name="news.content" cols="100" rows="8" >
			
			</textarea>
			<br />
			<input  type="text" name="news.author" placeholder="作者"/>
			<input  type="text" name="news.source" placeholder="来源"/>
			<br/>
			<s:token></s:token>
			<input type="submit" name="button" value="提交内容" />
		</form>
		
	</div>
</body>
</html>